﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.FactoryUI {
    import flash.events.*;
    import flash.display.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import flash.filters.*;
    import org.aswing.geom.*;
    import org.aswing.event.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class SuppliesDialogView extends JPanel {

        protected var m_bgAsset:DisplayObject;
        protected var m_assetDict:Dictionary;
        protected var m_items:Array;
        protected var m_title:String;

        public function SuppliesDialogView(_arg1:Dictionary, _arg2:Array, _arg3:String="", _arg4:Function=null){
            super(new SoftBoxLayout(SoftBoxLayout.X_AXIS, 0, SoftBoxLayout.CENTER));
            this.append(ASwingHelper.horizontalStrut(20));
            this.m_title = _arg3;
            this.m_items = _arg2;
            this.m_assetDict = _arg1;
            this.init();
        }
        private function closeMe(_arg1:AWEvent):void{
            dispatchEvent(new Event(Event.CLOSE, true));
        }
        private function init():void{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP);
            var _local2:JPanel = new JPanel(new BorderLayout());
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP);
            var _local4:JButton = new JButton();
            var _local5:DisplayObject = (new (this.m_assetDict["close_button"])() as DisplayObject);
            _local4.wrapSimpleButton(new SimpleButton(_local5, _local5, _local5, _local5));
            _local4.addActionListener(this.closeMe, 0, false);
            _local3.append(_local4);
            _local2.append(_local3, BorderLayout.EAST);
            var _local6:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.TOP);
            var _local7:AssetPane = new AssetPane((new (this.m_assetDict["forklift"])() as DisplayObject));
            var _local8:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, -10);
            _local8.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 5)));
            var _local9:JTextField = ASwingHelper.makeTextField((this.m_title + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 50, 0xFFFFFF, -4);
            _local9.filters = [new GlowFilter(489375, 1, 4, 4, 10)];
            _local8.appendAll(_local7, _local9);
            _local6.append(ASwingHelper.verticalStrut(30));
            _local6.append(_local8);
            _local2.append(_local6, BorderLayout.CENTER);
            _local2.append(ASwingHelper.horizontalStrut(20), BorderLayout.WEST);
            _local1.append(_local2);
            this.m_bgAsset = (new (this.m_assetDict["supplies_background"])() as DisplayObject);
            var _local10:MarginBackground = new MarginBackground(this.m_bgAsset, new Insets(20, 0, 0, 0));
            this.setBackgroundDecorator(_local10);
            var _local11:IntDimension = new IntDimension(this.m_bgAsset.width, (this.m_bgAsset.height + 20));
            this.setPreferredSize(_local11);
            this.setMaximumSize(_local11);
            this.setMinimumSize(_local11);
            var _local12:SuppliesScrollingList = new SuppliesScrollingList(this.m_items, SuppliesCellFactory, 0, 2, 2);
            _local1.append(ASwingHelper.verticalStrut(18));
            _local1.append(_local12);
            this.append(_local1);
        }

    }
}//package Display.FactoryUI 
